<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>

<script>
        function loadIng(url){
        return new Promise((resolve,reject) => {
            let img = new Image();
            img.src = url;
            img.onload = () => {
                resolve(img);
            }
            img.onerror = () => {
                reject('图片加载失败')
            }
        })
    };
    let imgUrl = './1.jpg';
    let imgUrl2 = './1.jpg';
    let imgUrl3 = './1.jpg';
// ======================================================= 
    // promise.all
    Promise.all([
        loadIng(imgUrl),
        loadIng(imgUrl2),
        loadIng(imgUrl3)
    ]).then((els) => {
        for (let i in els){
            document.documentElement.appendChild(els[i]);
   
        }
    }).catch((erro) => {
        console.log(erro);
    })

</script>